{* FILTERS *}

<center>
<form method="post" id="prj_form">
 	<input type="hidden" name="flowid" id="flowid" value="{$flowid}">
	<input type="hidden" name="action" id="action" value="spradmin">
	<input type="hidden" name="op" id="op" value="add">
	<input type="hidden" name="id" id="id" value="{$id}">
	<input type="hidden" name="sid" id="sid" value="">
	 <table width="100%" cellpadding="0" cellspacing="0">
	   <tr>
		 <td>&nbsp;{$lang.name}</td>
		 <td><input type="text" size="20" maxlength="50" name="name" id="name" class="txt"></td>
		</tr>
	   <tr>
		 <td>&nbsp;{$lang.path}</td>
		 <td><input type="text" size="50" maxlength="50" name="path" id="path" class="txt"></td>
		</tr>
		</tr>
			 <td align="right" colspan="2">
			 <div id="add_form">
			 {include file="button.tpl" name=$lang.new action="doProcess('prj_form')"}
			 </div>
			 <div id="edit_form" style="display: none;">
			 {include file="button.tpl" name=$lang.ok action="doProcess('prj_form')"}
			 &nbsp;{include file="button.tpl" name=$lang.cancel action="cancelEditSub()"}
			 </div>
			 </td>
	   </tr>
	   <tr>
	   	<td align="center" colspan="2">
	   		{$lang.sprnote}
	   	</td>
	   </tr>
	 </table>	
</form>
</center>


<center>
<table class="basetable" align="center" width="100%" border="0" cellpadding="0" cellspacing="0">

	<thead>
		<tr>
			<th>{$lang.name}</th>
			<th>{$lang.path}</th>
			<th>{$lang.status}</th>
			<th>&nbsp;</th>
		</tr>
	</thead>

	{* TABLE BODY - DYNAMIC *}
	<tbody>
		{assign var="rowclass" value="uneven"}
		{foreach from=$list item=row}
			{eval var=$row->status assign="stid"}
			{eval var=$row->ready assign="strd"}
			<tr class="{$rowclass}" {if $stid neq 'ACTIVE'} style="font-style: italic" {/if}>
				<td>{$row->name}</td>
				<td>{$row->path}</td>				
				<td>{$lang.$stid}</td>
				<td>
					{if $stid eq 'ACTIVE'}
						{* if $strd eq 'todo' *}
							<span onclick="redirectSub('{$row->id}')" class="link">{$lang.generate}</span>&nbsp;
						{* /if *}
						<span onclick="updateRequestSub('{$row->id}','deact')" class="link">{$lang.deactivate}</span>&nbsp;
					{else}
						<span onclick="updateRequestSub('{$row->id}','act')" class="link">{$lang.activate}</span>&nbsp;
					{/if}
					<span onclick="startEditSub('{$row->id}','{$row->name}','{$row->path}')" class="link">{$lang.edit}</span>
				</td> 
			</tr>
			{if $rowclass eq 'even'}
				{assign var="rowclass" value="uneven"}
			{else}
				{assign var="rowclass" value="even"}
			{/if}			
		{/foreach}

	</tbody>

</table>
<center>

<form method="post" id="list_form">
	<input type="hidden" name="flowid" id="flowid" value="{$flowid}">
	<input type="hidden" name="action" id="action" value="spradmin">
	<input type="hidden" name="op" id="op" value="">	
	<input type="hidden" name="sid" id="sid" value="">
	<input type="hidden" name="id" id="id" value="{$id}">
</form>